const logger = require('../utils/log');
const querystring = require('querystring');

const query = 'id=234&name=Tom&from=北京';
const query2 = 'id:234/name:Tom/from:北京';
const queryEscape = 'id%3D234%26name%3DTom%26from%3D%E5%8C%97%E4%BA%AD';
const queryObj = { id: '234', name: 'Tom', from: '北京' };


// logger.debug(querystring.parse(query));
// logger.debug(querystring.parse(query2, '/', ':'));
// logger.debug(querystring.escape(query))   
// logger.debug(querystring.unescape(queryEscape));
// logger.debug(querystring.stringify(queryObj, '&', '/'));
logger.debug(querystring.stringify(queryObj, null, null, {
    encodeURIComponent(string) {
        return querystring.unescape(string);
    }
}));
